package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.domain.R;
import com.zzyl.nursing.domain.Elder;
import com.zzyl.nursing.domain.FamilyMember;
import com.zzyl.nursing.dto.ElderDto;
import com.zzyl.nursing.dto.HealthDataDto;
import com.zzyl.nursing.dto.UserLoginRequestDto;
import com.zzyl.nursing.service.IDeviceDataService;
import com.zzyl.nursing.service.IDeviceService;
import com.zzyl.nursing.service.IFamilyMemberService;
import com.zzyl.nursing.vo.ElderFamilyVo;
import com.zzyl.nursing.vo.HealthDataVo;
import com.zzyl.nursing.vo.LoginVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.bouncycastle.LICENSE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 老人家属Controller
 * 
 * @author ruoyi
 * @date 2024-09-19
 */
@RestController
@RequestMapping("/member/user")
@Api(tags = "老人家属的接口")
public class FamilyMemberController extends BaseController {
    @Autowired
    private IFamilyMemberService familyMemberService;

    @PostMapping("/login")
    @ApiOperation("小程序登录")
    public AjaxResult login(@RequestBody UserLoginRequestDto dto) {
        LoginVo loginVo = familyMemberService.login(dto);
        return success(loginVo);
    }

    @PostMapping("/add")
    @ApiOperation("绑定家人")
    public AjaxResult add(@RequestBody ElderDto dto) {
        familyMemberService.add(dto);
        return success();
    }

    /**
     * 查询老人健康数据
     */
    @PostMapping("/QueryDevicePropertyStatus")
    @ApiOperation("查询老人健康数据")
    public R<HealthDataVo> QueryDevicePropertyStatus(@RequestBody HealthDataDto dto) {
        HealthDataVo vo = familyMemberService.QueryDevicePropertyStatus(dto);
        return R.ok(vo);
    }
}

//    /**
//     * 查询老人家属列表
//     */
//    @GetMapping("/my")
//    @ApiOperation("查询老人家属列表")
//    public R<List<WechatElderVo>> my(){
//
//    }
//}
